package com.goldgov.securityworkbench.swbuser.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.goldgov.kcloud.core.json.JsonQueryObject;
import com.goldgov.login.web.model.LoginAuthUser;
import com.goldgov.securityworkbench.swbuser.service.ISwbUserService;
import com.goldgov.securityworkbench.swbuser.service.SwbUserBase;
import com.goldgov.securityworkbench.swbuser.service.SwbUserQuery;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/workbench/swbuser")
@Api("管理员接口")
public class SwbUserController {

	@Autowired
	private ISwbUserService swbUserService;
	
	
	@RequestMapping("/findAllSwbUserListByPage")
	@ApiOperation(value = "查询管理员", notes ="")
	/*@ApiImplicitParams({ @ApiImplicitParam(name = "queryScopeCode", value = "机构code", paramType = "query"),
	 @ApiImplicitParam(name = "queryOrgId", value = "机构id", paramType = "query"),
	 @ApiImplicitParam(name = "queryUserName", value = "登录名", paramType = "query"),
	 @ApiImplicitParam(name = "queryDisplayName", value = "用户名称", paramType = "query")})*/
	public JsonQueryObject<SwbUserBase> findAllSwbUserListByPage( SwbUserQuery query,HttpServletRequest request,Model model){
//		if(query.getQueryScopeCode()==null||query.getQueryScopeCode()=="") {
//			String scopeCode=LoginAuthUser.getScopeCodeByFunctionID(AuthorityInfoInit.zbq,request);
//			query.setQueryScopeCode(scopeCode);
//		}
		List<SwbUserBase> list = swbUserService.findAllList(query);
		query.setResultList(list);
		return new JsonQueryObject<>(query);
	}
	
}
